/*
 * PopupLibInternalTypes.hpp
 *
 *  Created on: May 26, 2012
 *      Author: guillou
 */

#ifndef POPUPLIBINTERNALTYPES_HPP_
#define POPUPLIBINTERNALTYPES_HPP_

#include <string>
#include <PopupLibTypes.hpp>
#include <PopupOSAL.hpp>

namespace Popup
{
  struct FileTransferExt : public FileTransfer
  {
    unsigned int  totalNbFrames;
    unsigned int  frameNo;
    UserList targets;
    int notificationPeriod;
    unsigned long long checksum;

    FileTransferExt() {}
    ~FileTransferExt() {}

    // Send constructor
    FileTransferExt(MessageID p_messageID,
                    AttachmentID p_attachmentID,
                    const UserList & p_targets,
                    PopupUtils::FileStream *p_file,
                    const std::string & p_filepath);

    bool isNotificationRequired() const;
    bool isComplete() const;

    // Receive constructor
    FileTransferExt(MessageID p_messageID,
                    AttachmentID p_attachmentID,
                    PopupUtils::FileStream *p_file,
                    const std::string & p_filepath,
                    unsigned int  p_nbFrames,
                    unsigned int  p_totalSize);
  private:
    void computeNotificationPeriod();
  };
}

#endif /* POPUPLIBINTERNALTYPES_HPP_ */
